Ext.define('com.hh.form.CreateSourceCode', {
	extend : 'com.hh.base.BaseServicePanel',
	modal : true,
	title : '查看源码',
	width : 700,
	height : 450,
	layout : 'border',
	constructor : function(config) {
		this.config = config || {};
		this.superclass.constructor.call(this, this.config);

		var parentPenel = this.config.parentPenel;
		var tableName = parentPenel.tableName.getValue();
		var formSource = parentPenel.getFormSource();

		var resultCode = Request.synRequestObject(
				'form-CreateSource-createCode', {
					tableName : tableName,
					formSource : formSource,
					pageageName : this.config.parentPenel.packageName
							.getValue()
				});

		var mainTab = Ext.create("com.hh.base.BaseTabPanel", {
			padding : '1',
			region : 'center'
		});

		var jsListPanel = Ext.create('Ext.panel.Panel', {
			icon : 'struts-image?path=com/hh/form/img/script_16x16.gif',
			title : 'jsList脚本',
			layout : 'fit',
			items : Ext.create('Ext.form.HtmlEditor', {
				value : resultCode.pageListCode
			})
		});

		var jsEditPanel = Ext.create('Ext.panel.Panel', {
			icon : 'struts-image?path=com/hh/form/img/script_16x16.gif',
			layout : 'fit',
			title : 'jsEdit脚本',
			items : Ext.create('Ext.form.HtmlEditor', {
				value : resultCode.pageEditCode
			})
		});

		var beanPanel = Ext.create('Ext.panel.Panel', {
			icon : 'struts-image?path=com/hh/form/img/script_16x16.gif',
			layout : 'fit',
			title : 'JAVABEAN',
			items : Ext.create('Ext.form.HtmlEditor', {
				value : resultCode.javaBean
			})
		});

		var serviceCodePanel = Ext.create('Ext.panel.Panel', {
			icon : 'struts-image?path=com/hh/form/img/script_16x16.gif',
			layout : 'fit',
			title : 'serviceCode',
			items : Ext.create('Ext.form.HtmlEditor', {
				value : resultCode.serviceCode
			})
		});

		var actionCodePanel = Ext.create('Ext.panel.Panel', {
			icon : 'struts-image?path=com/hh/form/img/script_16x16.gif',
			layout : 'fit',
			title : 'actionCode',
			items : Ext.create('Ext.form.HtmlEditor', {
				value : resultCode.actionCode
			})
		});

		mainTab.add(jsListPanel);
		mainTab.add(jsEditPanel);
		mainTab.add(beanPanel);
		mainTab.add(serviceCodePanel);
		mainTab.add(actionCodePanel);

		var mainPanel = Ext.create('com.hh.base.BasePanel', {
			icon : 'struts-image?path=com/hh/form/img/computer2_16x16.gif',
			layout : 'fit'
		});
		mainPanel.add(mainTab);
		this.add(mainPanel);
	}
});